<?php
header("Access-Control-Allow-Origin: *");
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;



Route::get('/', 'index/index/index');
Route::get('door/open', 'api/Door/open');

Route::any('user/bindRoom', 'api/User/bindRoom');


Route::group(function () {
    Route::any('owner/getFamilyList', 'api/Owner/getFamilyList');
    Route::any('owner/addFamily', 'api/Owner/addFamily');
    Route::any('owner/getVisitorList', 'api/Owner/getVisitorList');
    Route::any('owner/addVisitor', 'api/Owner/addVisitor');
})->middleware([
        \app\api\middleware\CheckOwner::class,
    ]
);
Route::group(function () {
    Route::any('admin/strangerInfo', 'api/Admin/strangerInfo');
    Route::any('admin/strangerList', 'api/Admin/strangerList');
    Route::any('admin/strangerAudit', 'api/Admin/strangerAudit');

    Route::any('admin/staffOn', 'api/Admin/staffOn');
    Route::any('admin/staffOff', 'api/Admin/staffOff');
})->middleware([
        \app\api\middleware\CheckStaff::class,
    ]
);
